package Week12;
import java.util.regex.*;
import java.util.Scanner;

public class Main {
	public static void main(String[] arge){
		Scanner in=new Scanner(System.in);
		while(true){
			String str=in.nextLine();
		//String str="For my money, the important thing ";
				String regEx="^(0|[1-9][0-9]*)$";
				boolean result=Pattern.compile(regEx).matcher(str).find();
				System.out.println(result);
		}
			
	}
}
